import { request } from 'umi';

export async function fakeSubmitForm(params: any) {
    return request('/api/cmsArticle/saveOrUpdate', {
        method: 'POST',
        data: params,
    });
}
export async function currentData(params: any) {
    return request(`/api/doctorAttestation/current`, {
        method: 'get',
        data: params,
    });
}
export async function queryDetail(params: any) {
    return request('/api/cmsArticle/' + params.id, {
        method: 'get',
        data: params,
    });
}

export async function list(params: any) {
    return request(`/api/cmsArticle/page`, {
        method: 'post',
        data: params,
    });
}
export async function jiblist(params: any) {
    return request(`/api/bsDisease/leve2/page?diseaseName=${params.name}&pageSize=1000&pageNum=1`, {
        method: 'post',
        data: params,
    });
}

/** 修改文章 PUT /api/ */
export async function update(params: any) {
    return request('/api/cmsArticle/updateById', {
        method: 'post',
        data: params,
    });
}

/** 删除文章 DELETE /api/ */
export async function remove(data: { key: number[] }, options?: { [key: string]: any }) {
    return request<Record<string, any>>('/api/specialSubject/' + data.key, {
        data,
        method: 'DELETE',
        ...(options || {}),
    });
}

export async function deal(params: any) {
    return request('/api/cmsArticle/updateById', {
        method: 'post',
        data: params,
    });
}
